package ovm.gui;

import com.vaadin.ui.TextField;
import com.vaadin.ui.PasswordField;
import com.vaadin.ui.Button;
import ovm.gui.actions.authorization.AuthorizeButtonAction;

public class AuthorizationWindow extends AbstractWindow {

    private TextField loginText;
    private PasswordField passwordText;
    private Button authorizeButton;

    public AuthorizationWindow() {
        super();
        loginText = new TextField();
        passwordText = new PasswordField();
        authorizeButton = new Button();
    }

    @Override
    public void draw() {
        this.setCaption("Вход в систему");
        loginText.setCaption("Введите логин");
        passwordText.setCaption("Введите пароль");
        authorizeButton.setCaption("Войти");
        authorizeButton.addListener(new AuthorizeButtonAction(this));
        this.addComponent(loginText);
        this.addComponent(passwordText);
        this.addComponent(authorizeButton);
    }

    public TextField getLoginText() {
        return loginText;
    }

    public PasswordField getPasswordText() {
        return passwordText;
    }

}
